export default (key, name, type) => {
  if (!type) type = "camunda";
  const TYPE_TARGET = {
    activiti: "http://activiti.org/bpmn",
    camunda: "http://bpmn.io/schema/bpmn",
    flowable: "http://flowable.org/bpmn"
  };
  return `
  <?xml version="1.0" encoding="UTF-8"?>
  <bpmn2:definitions 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" 
  xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" 
  xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" 
  xmlns:di="http://www.omg.org/spec/DD/20100524/DI" 
  xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" 
  id="diagram_${key}" 
  targetNamespace="${TYPE_TARGET[type]}">
    <bpmn2:process id="${key}" name="${name}" isExecutable="true">
      <bpmn2:startEvent id="StartEvent_1">
        <bpmn2:outgoing>Flow_02ioomr</bpmn2:outgoing>
      </bpmn2:startEvent>
      <bpmn2:userTask id="Activity_1oq4hvx" name="0_创建审批_N_N_N" activiti:assignee="\${assignee0}">
        <bpmn2:incoming>Flow_02ioomr</bpmn2:incoming>
      </bpmn2:userTask>
      <bpmn2:sequenceFlow id="Flow_02ioomr" sourceRef="StartEvent_1" targetRef="Activity_1oq4hvx" />
    </bpmn2:process>
    <bpmndi:BPMNDiagram id="BPMNDiagram_1">
      <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="${key}">
        <bpmndi:BPMNEdge id="Flow_02ioomr_di" bpmnElement="Flow_02ioomr">
          <di:waypoint x="448" y="258" />
          <di:waypoint x="500" y="258" />
        </bpmndi:BPMNEdge>
        <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
          <dc:Bounds height="36.0" width="36.0" x="412.0" y="240.0"/>
        </bpmndi:BPMNShape>
        <bpmndi:BPMNShape id="Activity_1oq4hvx_di" bpmnElement="Activity_1oq4hvx">
          <dc:Bounds x="500" y="218" width="100" height="80" />
        </bpmndi:BPMNShape>
      </bpmndi:BPMNPlane>
    </bpmndi:BPMNDiagram>
  </bpmn2:definitions>
  `;
};
